#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <sys/wait.h>
int main()
{
    putenv("HHHHHHHH=123456789");
    printf("testexec begin...\n");
    pid_t id=fork();
    //char *const argv[]=
    //{
    //    (char*)"ls",
    //    (char*)"-a",
    //    (char*)"-l",
    //    (char*)"--color",
    //    NULL
    //};
    char *const argv[]=
    {
        (char*)"mypragma",
        (char*)"-a",
        (char*)"-b",
        NULL
    };
    char *const envp[]=
    {
        (char*)"HAHA=11111",
        (char*)"HEHE=22222",
        NULL,

    };
    extern char**environ;
    if(id==0)
    {
        //execl("./mypragma","mypragma",NULL);
        execvpe("./mypragma",argv,environ);
 //       execv("/usr/bin/ls",argv);
        //execl("/usr/bin/lsss","lsss","-a","-l",NULL);
        exit(1);
    }
    int status=0;
    pid_t rid=waitpid(id,&status,0);
    if(rid>0)
    {
        printf("father wait success!child exit code:%d\n",WEXITSTATUS(status));
    }
    printf("testexec end!...\n");
    return 0;
}
